/**
 * 动物类
 */
public class Horse {

    public String name;

    public String age;

    public String water;

    Horse(String inputName, String inputAge, String inputWater) {
        this.name = inputName;
        this.age = inputAge;
        this.water = inputWater;
    }

    /**
     *xm的年龄和xm喜欢喝什么
     */
    public void run() {
        String he = "喝";
        System.out.println(name + age + "岁了");
        System.out.println(name +"喜欢"+ he + water);
    }

    /**
     * food 食物
     * 喜欢吃什么
     * @param food
     */
    public void eat(String food) {
        System.out.println(name + "喜欢吃" + food);
    }

    public static void main(String[] args) {
            //创建的对象：xm
            Horse XM = new Horse("小马","20","水");
            XM.eat("草");
            XM.run();
        }
}

